﻿Public Class Form4

    Dim m_sID As String

    Public Property ID() As String
        Get
            Return m_sID
        End Get
        Set(ByVal value As String)
            m_sID = value
        End Set
    End Property

    Private Sub TranscoursenoBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TranscoursenoBindingNavigatorSaveItem.Click
        Me.Validate()
        Me.TranscoursenoBindingSource.EndEdit()
        Me.TranscoursenoTableAdapter.Update(Me.TransferDataSet.Transcourseno)

    End Sub

    Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'TransferDataSet.Transcourseno' table. You can move, or remove it, as needed.
        'Me.TranscoursenoTableAdapter.Fill(Me.TransferDataSet.Transcourseno)

        LoadYear()
        LoadTerm()

        Me.TranscoursenoTableAdapter.FillByIDs(Me.TransferDataSet.Transcourseno, ID)

    End Sub

    ' Display year information
    Private Sub LoadYear()
        With YearComboBox
            .Items.Add("")
            .Items.Add(DateTime.Today.Year - 4)
            .Items.Add(DateTime.Today.Year - 3)
            .Items.Add(DateTime.Today.Year - 2)
            .Items.Add(DateTime.Today.Year - 1)
            .Items.Add(DateTime.Today.Year)
            .Items.Add(DateTime.Today.Year + 1)
            .Items.Add(DateTime.Today.Year + 2)
            .Items.Add(DateTime.Today.Year + 3)
            .Items.Add(DateTime.Today.Year + 4)
        End With
    End Sub

    ' Displays term information
    Private Sub LoadTerm()
        With TermComboBox
            .Items.Add("")
            .Items.Add(1)
            .Items.Add(2)
            .Items.Add(3)
        End With
    End Sub

End Class